package com.cn.kabalifeuser.ui.integral.adapter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.cn.kabalifeuser.R;
import com.cn.kabalifeuser.ui.integral.bean.DetailsInfoBean;
import com.cn.kabalifeuser.utils.LoggerUtils;
import com.flyco.roundview.RoundTextView;

import java.util.List;

/**
 * Created by 晓林 on 2020/9/14.
 * function:
 */
public class SpecArrItemsAdapter extends BaseQuickAdapter<DetailsInfoBean.ResultBean.SpecArrBean.SpecItemBean, BaseViewHolder> {
    public SpecArrItemsAdapter(int layoutResId, @Nullable List<DetailsInfoBean.ResultBean.SpecArrBean.SpecItemBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, DetailsInfoBean.ResultBean.SpecArrBean.SpecItemBean item) {

        helper.addOnClickListener(R.id.tv_title);
        RoundTextView tvTitle = helper.getView(R.id.tv_title);
        tvTitle.setText(item.getItem());
        if (item.isCheck()) {
            tvTitle.setTextColor(this.mContext.getResources().getColor(R.color.main_white));
            tvTitle.getDelegate().setBackgroundColor(this.mContext.getResources().getColor(R.color.main_color));
        } else {
            tvTitle.setTextColor(this.mContext.getResources().getColor(R.color.font_000));
            tvTitle.getDelegate().setBackgroundColor(this.mContext.getResources().getColor(R.color.app_color_f6));
        }
    }
}
